Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CAM import for stable FreeCAD release #245

Merged
merged 1 commit into from
Mar 3, 2025
Merged

Conversation

andredunford
Copy link
Contributor

@andredunford andredunford commented Jan 22, 2025

Issue:

In stable FC 1.0.0, Add Tracks fails when creating some footprint geometries with the error:

module 'CAM' has no attribute 'Area'

This appears to happen because the new stable version reverted the Path workbench name back to CAM; possibly for backward compatibility.

FC-0 20 FC-1 0 0
Left: v0.20 'Path' workbench. Right: v1.0.0 renamed back to 'CAM' workbench.

A previous try/except statement patch (996e609) tried to accommodate various builds using the older CAM module, however this now fails in the stable release.

Resolution:

Reverse the order of the import try statement. Ensure that the first attempt to load refers to the more up-to-date Path module, and falls back to the older CAM module only if the Path module is not found.

This has been tested on the current stable version FC-1.0.0 and and older version FC-0.20.

@BraidenPsiuk
Copy link
Contributor

Hi, I'm the one who was trying to support other builds 👋 interesting that they changed it back.
I just tested your patch in the RealThunder branch, it seems to load properly there, so hopefully this should be good to go! Thanks for helping to ensure it works across multiple FreeCAD builds 😄

@andredunford
Copy link
Contributor Author

andredunford commented Jan 22, 2025

Hi Braiden, thanks for testing with the RealThunder branch; glad to hear it's working there as well. Your fix made sense, but this just prioritizes the Path module, which, I believe, superseded CAM in previous releases.

After digging into the 1.0.0 source a bit, CAM appears to have been brought back, and Path was made a sub-module of it. The import order becomes relevant because there are now references to both.

@easyw easyw merged commit 3697003 into easyw:master Mar 3, 2025
@andredunford
Copy link
Contributor Author

Hello @easyw

Thank you for merging my changes, I was looking forward to getting back to tracking the main repo rather than my patched fork. However, I noticed that you manually reverted my changes in a following commit directly after the merge today.

Unfortunately, as noted in the description for this pull request, that leads to failure during Add Tracks for custom footprint/pad geometries with the following error:

module 'CAM' has no attribute 'Area'

I'm wondering if this reversion was an oversight on your part, or if my changes caused an issue in your tests? My changes were backward compatible with the versions tested above.

Thanks for any info you can provide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants